#ifndef CELL_H_
#define CELL_H_

#include <iostream>
#include <vector>
#include "math.h"
#include "Point.h"
#include "Variables.h"

using namespace std;

/*
Represents a Partition
*/
class Cell
{
	public:
		vector< vector < Cell* > > children;
		int splitTop, splitRight, splitBottom, splitLeft;
		Point *ll, *ul, *ur, *lr;
		int gX;
		int gY;
		Cell(float, float, float);
		Cell(float, float, float, float);

	private:
		void initializeCell(float, float, float, float);
		void doRecursiveSplit();
		int toBeSplit(Point*, Point*);
		void checkForSplit();
		float functionApproximatedValue(Point*, Point*, Point*);
		Point* getMiddlePoint(Point*, Point*); 
		
};

ostream& operator<<(ostream&,Cell*);

#endif